package edu.cycle;

/*空心长方形*/

import java.util.Scanner;

public class cycle0kc {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入长方形的长：");
        int a = scan.nextInt();
        System.out.println("请输入长方形的宽：");
        int b = scan.nextInt();
        for (int i = 1; i <= a; i++) {
            for (int j = 1; j <= b; j++) {
                if (i == 1 || i == a || j == 1 || j == b)
                    System.out.print("*");
                else {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}
